//
// Created by lyc on 2025/2/24.
//
#include "iostream"
using namespace std;

int whoDrink(int ATalk, int AShow, int BTalk, int BShow){
    /**
     * function: 判断谁该喝, XShow = ATalk + BTalk -> XWin -> the other one Drink
     * param: A喊，A划，B喊，B划
     * return: 0：A喝  1：B喝  -1：都不喝
     */

    if(AShow != BShow) {
        if (AShow == ATalk + BTalk)
            return 1;
        else if (BShow == ATalk + BTalk)
            return 0;
    }
    return -1;

}

void algorithm5(){
    int number = 0;
    cin >> number;

    int ATalk, AShow, BTalk, BShow;
    int ATimes = 0, BTimes = 0;

    while(number--){
        cin >> ATalk >> AShow >> BTalk >> BShow;

        if(whoDrink(ATalk, AShow, BTalk, BShow) == 0)
            ATimes++;
        else if(whoDrink(ATalk, AShow, BTalk, BShow) == 1)
            BTimes++;
    }

    cout << ATimes << " " << BTimes << endl;
}
